package org.dstart.object.color.sub
{
	import flash.display.Sprite;

	public class SubColorObject extends Sprite
	{
		private var m_color:uint;			//	当前对象的颜色值
		private var m_bgSprite:Sprite;		//	用于显示填充颜色的对象
		
		private var m_size:Number;
		
		public function  SubColorObject(numColor:uint = 0xFFFFFF, xx:Number = 0, yy:Number = 0, size:Number = 10)
		{
			this.x = xx;
			this.y = yy;
			this.color = numColor;
			this.m_size = size;
			
			ShowObject();
		}
		
		public function get color():uint
		{
			return m_color;
		}
		
		public function set color(col:uint):void
		{
			m_color = col;
		}
		
		/**********	以下为类的私有方法 *********/
		
		private function ShowObject():void
		{
			m_bgSprite = new Sprite();
			m_bgSprite.graphics.beginFill(this.color, 1);
			m_bgSprite.graphics.lineStyle(1, 0x000000, 1, true);
			m_bgSprite.graphics.drawRect(0, 0, m_size, m_size);
			m_bgSprite.graphics.endFill();						
			
			addChild(m_bgSprite);						
		}		
	}
}